package com.liu.springmvc.adapter;

import org.springframework.stereotype.Component;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author LIU
 * @version 1.0
 * @description TODO
 * @date 2024/1/23 15:32
 */
@Component
public class MyServletHandlerAdapter implements HandlerAdapter{
    @Override
    public boolean supports(Object handler) {
        return handler instanceof Servlet;
    }

    @Override
    public Object handler(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        Servlet servlet = (Servlet) handler;
        servlet.service(request,response);
        return null;
    }

}
